﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>运动员项目管理</title>
    <link href="<%=Url.Content("~/Content/page.css") %>" rel="stylesheet" type="text/css" />

    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>

</head>
<body>
    <%using (Html.BeginForm())
      { %>
    <table>
        <tr>
            <td>
                查询内容：<input type="text" name="txtQuery" id="txtQuery" />
                查询类型<select name="sltType" id="sltType">
                    <option value="1">按班级</option>
                    <option value="2">按项目</option>
                    <option vlaue="3">按运动员</option>
                </select>
                <input type="button" value="查询" onclick="queryinfo()" />
                <input type="button" value="导出" onclick="exportinfo()" />
            </td>
        </tr>
        <tr>
            <td>
                <div id="divtable">
                </div>
            </td>
        </tr>
    </table>
    <%} %>

    <script language="javascript" type="text/javascript">
        function queryinfo() {
            debugger;
            txt = $("#txtQuery").val();
            slt = $("#sltType").val();
            $.ajax({
                url: 'PlayerItems/QueryInfo',
                data: {
                    qtxt: txt,
                    qslt: slt
                },
                type: 'POST',
                dataType: 'json',
                success: function(data) {
                    $("#divtable").html(data);
                },
                error: function(data) {
                    alert("获取数据失败！");
                }
            });
        }
        function exportinfo() {
            txt = $("#txtQuery").val();
            slt = $("#sltType").val();
            document.location.href = "/PlayerItems/ExportInfo/" + txt + "," + slt;
        }
    </script>

</body>
</html>
